package heima.lm.oschina;

import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.net.ConnectivityManager;
import android.os.Handler;
import android.os.Message;

import java.util.LinkedList;
import java.util.List;

import okhttp3.OkHttpClient;

/**
 * Created by herenxue on 2017/4/1.
 */

public class BaseApplication extends Application {
    public static Application mApp;
    public static OkHttpClient mClient;
    public static List<Activity> mActivityList;
    public static Handler mHandler;

    @Override
    public void onCreate() {
        super.onCreate();
        mApp = this;
        mClient = new OkHttpClient();
        mActivityList = new LinkedList<>();
        mHandler = new Handler();
    }

    public static void exit() {
        for (Activity activity : mActivityList) {
            activity.finish();
        }
        System.exit(0);
    }
}
